package com.spider.downloader;

import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;

import com.spider.util.CatchUtil;



/**
 * 
 * 抓取页面处理类
 * 
 * @author liuhao
 * 
 */
public class Downloader {
	
	private String catch_url;
	public Downloader() {

	}
	public Downloader(String catch_url) {
		this.catch_url = catch_url;
	}
	
	public void getCatchPage(String catch_url){
		
		try {
			URL url = new URL(catch_url);
			HttpURLConnection conn = (HttpURLConnection) url.openConnection();
			conn = CatchUtil.setRequestProperty(conn);
			String catch_str = CatchUtil.bufferRead(conn.getInputStream());
			System.out.println(catch_str);
			
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	
	}
	
	

}
